package day12.reflect;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Date;

public class Test4 {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        /*
        Date
          | - getTime()
          | - setTime(long)
         */
        Class<Date> c = Date.class;
        Date d = new Date();
        Method getTime = c.getDeclaredMethod("getTime");
        Method setTime = c.getDeclaredMethod("setTime", long.class);
        Object r = getTime.invoke(d);
        System.out.println(r);

        setTime.invoke(d, 90000000000L);
        System.out.println(d);


    }
}
